#ifndef FOOTBALLTABLE_H
#define FOOTBALLTABLE_H

#include "match.h"
#include "teamresult.h"
#include <map>
#include <vector>
#include <string>
#include <utility>

class FootballTable {

public:
    FootballTable(const std::vector<std::string> &teams);

    void print();
    void print(const std::string &team);
    bool push(const std::string &matchResult);
    bool push(const std::string &team1,
              const int goalsTeam1,
              const std::string &team2,
              const int goalsTeam2);

    int getScore(const std::string &team);

    bool addTeam(const std::string &team);

private:
    const int _WIN_SCORE = 3;
    const int _DRAW_SCORE = 1;

    std::map<std::string, TeamResult> _table;

    static Match _parseString(std::string str);
    static bool _compare(const std::pair<std::string, TeamResult>&,
	                     const std::pair<std::string, TeamResult>&);
};

#endif
